// pages/classificationGuide/classificationGuide.js
import {
    shareOptions,
} from "../../utils/access";

Page({

    /**
     * 页面的初始数据
     */
    data: {
       tabList: [
           {label:'厨余垃圾',icon: 'https://image-classify.daieco.com/kejian-quanzi/ghnndbEdp63xc7028255431e807a90d3d936bb82ee82.png'},
           {label:'其他垃圾',icon: 'https://image-classify.daieco.com/kejian-quanzi/SRKJSC3ooUR1c20e6fb470667f3e542395563bbcd2f1.png'},
           {label:'可回收物',icon: 'https://image-classify.daieco.com/kejian-quanzi/uhCjjVCGymui9d5006c48229f453e3996d0daec29be8.png'},
           {label:'有害垃圾',icon: 'https://image-classify.daieco.com/kejian-quanzi/A69kMGYbdUTx9fae433c2364a849f0ccfcf8da1c1642.png'},
       ],
       list: [
       {path: 'https://image-classify.daieco.com/kejian-quanzi/fyYCm8N4cTHTbdebdbeaef9795235051de92e1135a7e.png',height: '1129rpx' },
       {path: 'https://image-classify.daieco.com/kejian-quanzi/kRHmkKKFuRPC0ec67262a1d656c276ba9b0d18f7df76.png',height: '886rpx' },
       {path: 'https://image-classify.daieco.com/kejian-quanzi/gU3b6E8dBjb568d2aa15582cb25990f54f53dfad3576.png',height: '1106rpx' },
       {path: 'https://image-classify.daieco.com/kejian-quanzi/VTmeH6Jr3teldb86a2fc3e7ab96a727841e0d6d4ab52.png',height: '1156rpx' }
        ],
        currentTab: 0,
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {

    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {

    },
     // tab切换
     switchTab(e) {
        wx.pageScrollTo({
            scrollTop: 0
          })
        this.setData({
            currentTab: e.detail.current
        });
    },
    // 滚动切换标签
    switchNav(e) {
        let cur = e.currentTarget.dataset.current;
        if (this.data.currentTab == cur) {
            return false;
        } else {
            this.setData({
                currentTab: cur
            });
        }
    },
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function (e) {
        return shareOptions('default',e)
    }
})